<html>
<head>
  <script language="javascript">
      function button_onclick () {
        el = document.getElementById ('text');
	el.innerHTML = "you clicked me!";
      }
  </script>
</head>

<body>
  <span id="text">you haven't clicked me...</span><br/>
  <button id="button" onClick="javascript:button_onclick()">Click me!</button>




  <!-- the test for the above html -->
  <script language="javascript">

    var TestFixture = {
        test_button: function() {
    	JSUnit_BindElement ("text");

    	Assert.NotNull ("JSUnit_GetElement()", "text element exists");
    	Assert.NotNull ("JSUnit_GetElement('button')", "button element exists");
    	Assert.AreEqual ("you haven't clicked me...", "JSUnit_GetElement().innerHTML", "initial text");

    	var button = JSUnit_GetElement ("button");
    	JSUnit_Click(button);

    	/* it's okay to put stuff after this JSUnit_Click call since
    	 * we didn't call JSUnit_TestCausesPageLoad */

    	Assert.AreEqual ("you clicked me!", "JSUnit_GetElement().innerHTML", "text after button click");
        }
    };  

  </script>
</body>

</html>